import { request } from "@/api/request";

export const $export = {
  // 运输列表接口
  getByStatus: data => request({
    url: '/handheld/export/exportByStatus',
    method: 'post',
    data: data
  }),
  // 运输报告接口
  getDetils: data => request({
    url: '/handheld/export/getDetils',
    method: 'post',
    data
  }),
  // 新增船段接口
  save: data => request({
    url: '/handheld/export/save',
    method: 'post',
    data
  }),
  // 编辑船段接口
  modify: data => request({
    url: '/handheld/export/modify',
    method: 'post',
    data
  }),
  // 删除船段接口
  remove: data => request({
    url: '/handheld/export/remove',
    method: 'post',
    data
  }),
  // 撤销发货
  deleteWarehouse: data => request({
    url: '/handheld/export/backGoods',
    method: 'post',
    data
  }),
  // 仓库提货详情
  getWareHouseDetils: data => request({
    url: '/handheld/export/getFactoryDetils',
    method: 'post',
    data
  }),
  // 确认提货接口
  getGoods: data => request({
    url: '/handheld/export/getGoods',
    method: 'post',
    data
  }),
  // 厂家签收
  signDetails: data => request({
    url: '/handheld/export/signDetails',
    method: 'post',
    data
  }),
  // 厂家确认签收
  receiptFiles: data => request({
    url: '/handheld/export/receiptFiles',
    method: 'post',
    data
  }),
  // 文件下载
  downFile: data => request({
    url: '/handheld/export/downFile',
    responseType:'arraybuffer',
    // responseType: 'blob',
    method: 'post',
    data
  }),
  // 获取航段值
  getDestinationHarbors: () => request({
    url: '/handheld/export/getDestinationHarbors',
    method: 'post'
  }),
  // 获取运输代理
  findCode: () => request({
    url: '/handheld/export/findCode',
    method: 'post'
  }),
  // 文件下载测试
  loadFile: data => request({
    url: 'inner/air/apply/loadFile',
    method: 'post',
    responseType: 'arraybuffer',
    // responseType: 'blob',
    data
  })
}

// 新增船段接口
function save (data) {
  return request({
    url: '/handheld/export/save',
    method: 'post',
    data
  })
}

// 编辑船段接口
function modify (data) {
  return request({
    url: '/handheld/export/modify',
    method: 'post',
    data
  })
}

// 删除船段接口
function remove (data) {
  return request({
    url: '/handheld/export/remove',
    method: 'post',
    data
  })
}
export default {
  save,
  modify, remove
}
